<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
	<form class="form-horizontal buyinfor-form" id="business-info">
		<div class="current-state-bno">
			<div class="submit-buttonleft">
				<button id="jsbzjSave" class="btn-danger-my btn btn-primary" type="button" onclick="jsbzjSaveOrUpdate();">保存</button>
				<button style="display: none" id="jsbzjUpdate" class="btn-danger-my btn btn-primary" type="button" onclick="jsbzjSaveOrUpdate();">修改</button>
			</div>
		</div>
		<div class="business-manwife">加收保证金</div>
		<div class="padding-nono">
			<input type="hidden" id="bzjId" />
			<table cellpadding="0" cellspacing="0" border="0"
				class="buyinfor-table">
				<tr>
					<td align="right"><label class="control-label np">加收时间：</label>
					</td>
					<td><input id="bzjjs_time" class="smallicontm form-control" onclick="laydate()" />
					</td>

					<td align="right"><label class="control-label np">加收金额：</label>
					</td>
					<td><input id="bzjjsje" type="text" class="form-control" /></td>
				</tr>

				<tr>
					<td align="right"><label class="control-label np">收款银行：</label>
					</td>
					<td><input id="bzjskyh" type="text"
						class="form-control" /></td>

				</tr>

				<tr>
					<td align="right" valign="top"><label
						class="control-label np">相关备注：</label></td>
					<td colspan="3"><textarea id="bzjsgbz"
							type="text" class="form-control"></textarea></td>
				</tr>
			</table>
		</div>
		<div class="business-manwife">经办信息</div>
		<div class="padding-nono">
			<table cellpadding="0" cellspacing="0" border="0"
				class="buyinfor-table">
				<tr>
					<td align="right"><label class="control-label np">经办人：</label>
					</td>
					<td><input id="bzjjb_name" class="form-control"
						readonly="readonly" value="${current_user_key.uname}" />
					</td>

					<td align="right"><label class="control-label np">经办时间：</label>
					</td>
					<td><input id="bzjjb_time" readonly="readonly"
						class=" form-control"  />
					</td>
				</tr>
			</table>
		</div>
	</form>
	
	<%@include file="/jsp/comm_js_include.jsp"%>
	<script type="text/javascript">
	var jsbzjSaveOrUpdate=function(){
    	var data={};
    	var url='${basePath}/DhOverdueDepositController/save';
    	if($("#bzjId").val()!=""){
    		data.id=$("#bzjId").val();
    		url='${basePath}/DhOverdueDepositController/modify';
    	}else{
	    	data.bzjcreated=$("#bzjjb_time").val();
	    	data.creatorName=$("#bzjjb_name").val();
	    	data.operator=$("#operator").val();
        	data.creator="${current_user_key.id}";
        	data.busiId= $.getUrlData("busiId");
        	data.cusId= $.getUrlData("cusId");
        	data.overdueId= $.getUrlData("overdueId");
    		
    	}
    	data.timeReceipt=$("#bzjjs_time").val();
    	data.amountReceipt=$("#bzjjsje").val();
    	data.bankReceipt=$("#bzjskyh").val();
    	data.remarks=$("#bzjsgbz").val();
    	$.dpAjax({
    		show:false,
    		url:url,
    		data:data,
			success: function(datas){
				 layer.msg('执行成功！', {icon: 6});
				  return;
             }
    	});
    }
	
	var getBzjDataById=function(){
    	var data={};
		data.busiId=$.getUrlData("busiId");
		$.dpAjax({
			show:false,
    		url:'${basePath}/DhOverdueDepositController/list',
			data:data,
			success: function(datas){
				var data=datas.result.rows;
				  if(data.length>0){
					  $("#bzjId").val(data[0].replaceId);
					  $("#bzjjs_time").val(data[0].timeReceipt);
					  $("#bzjjsje").val(data[0].amountReceipt);
					  $("#bzjskyh").val(data[0].bankReceipt);
					  $("#bzjjb_time").val(data[0].bzjcreated);
					  $("#bzjsgbz").val(data[0].remarks);
					 //layer.msg('执行成功！', {icon: 6});
					  $("#pksave").hide();
					  $("#jsbzjSave").hide();
					  $("#jsbzjUpdate").show();
					  return;
				  }
            }
    	});
    }
	</script>